package leetcode;

/**
 * 移除零
 */
public class Solution283 {
    public void moveZeroes(int[] nums) {
        int slow = 0,fast = 0;
        while(fast < nums.length){
            if(nums[fast] != 0){
                int temp = nums[slow];
                nums[slow] = nums[fast];
                if(temp==0){
                    nums[fast] = 0;
                }
                slow++;
            }
            fast++;
        }
    }
}
